package com.sbp.messsage_producer_demo.service.bs;

import com.sbp.message.api.entity.Message;
import com.sbp.message.message_producer.MessageProducer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TestMessageProducerImpl implements TestMessageProducerInterface {
    static final Logger logger = LoggerFactory.getLogger(TestMessageProducerImpl.class);

    @Autowired
    private MessageProducer messageProducer;

    @Override
    public void testMessage(String topic, String content) {
        Message message = messageProducer.produceMessageAndConfirmAsync(new Message(topic, content));

        // 执行业务逻辑相关 TODO ...............
    }

}
